//package com.yehangtech.designpattern.结构型_外观.door;
//
//import cjyyp.door.annotation.DoDoor;
//import cjyyp.door.config.StartService;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.Signature;
//import org.aspectj.lang.annotation.Around;
//import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Pointcut;
//import org.aspectj.lang.reflect.MethodSignature;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.lang.annotation.Annotation;
//import java.lang.reflect.Method;
//
//@Aspect
//@Component
//public class DoJoinPoint {
//    @Autowired
//    private StartService startService;
//
//
//    @Pointcut("@annotation(cjyyp.door.annotation.DoDoor)")
//    public void cutPoint(){
//
//    }
//
//    @Around(value = "cutPoint()")
//    public Object doDoor(ProceedingJoinPoint joinPoint) throws Throwable {
//        Signature signature = joinPoint.getSignature();
//        MethodSignature methodSignature = (MethodSignature) signature;
//        Method method = joinPoint.getClass().getMethod(methodSignature.getName(), methodSignature.getParameterTypes());
//        DoDoor annotation = method.getAnnotation(DoDoor.class);
//        String key = annotation.key();
//        for (String userName : startService.getUserName()) {
//            if (key.equals(userName)){
//                joinPoint.proceed();
//            }
//        }
//        return annotation.returnJson();
//    }
//}
